function pupupSendMsg(popupWindow, receiverID, receiverName)
{
	popupWindow.html('<form action="#" id="sendMsgForm" method="POST"><input type="hidden" id="action" name="action" /><input type="hidden" id="receiverID" name="receiverID" /><div class="popup1"><div class="popup_title">发送站内信</div><div id="closeWindow" class="popup_close"><a href="#"><span>关闭窗口</span></a></div></div><div class="popup2"><table border="0" cellspacing="0" cellpadding="0" class="popup_table"><tr><td>收信人：</td><td><span id="receiverName" name="receiverName"></span></td></tr><tr><td>标 题：</td><td><input type="text" name="msgTitle" id="msgTitle" class="input_1"></td></tr></table><div class="popup_textarea">内 容<br/><br/><textarea name="msgContent" id="msgContent" style="width:390px;height:150px;"></textarea></div><div class="popup_btns"><input type="button" id="submitSendMsgBtn" class="btn_1" value="发送"/>&nbsp;<input type="button" id="cancelSendMsgBtn" class="btn_5" value="取消"/></div></div><div class="popup3"></div></form>');
	
	$("#msgTitle").removeAttr('value');      
	$("#msgContent").removeAttr('value');  
	$("#sendMsgForm>input[name='action']").attr('value','send');
	$("#receiverID").attr('value',receiverID);
	$("#receiverName").attr('innerHTML', receiverName);
	
	var sendMsgValidator = $("#sendMsgForm").validate(
	{
        rules: 
        {      
			msgTitle: { required: true, maxlength: 30 },
            msgContent: { required: true , maxlength: 1000}
         },
         messages: 
         {
        	msgTitle: { required:"需要输入标题", maxlength:'最多输入30个字符'},        
            msgContent: { required:"需要输入内容，1-1000字", maxlength:'最多输入1000个字符'}                 
         },
         submitHandler: function() {}
     });
	
	$("#submitSendMsgBtn").click(function() 
	{
		 if(sendMsgValidator.form())
		 {
			 var params = $("#sendMsgForm").serializeArray();
			 
			 $.ajax(
			 {
				 type: 'post',
				 url: edp_domain_url + 'ajax_msg/?tiny=1',
	             data: params,
	             timeout: 5000,
				 global:false,
		         beforeSend: function()
		         {
					 $.blockUI({ message: '正在发送...',
					 css: { padding:'5px',color:'#CC0000'}});
				 },
			     error: function()
			     {
					 $.blockUI({ message: '发送失败...',
					 css: { padding:'5px',color:'#CC0000'}});
			     },
	             success: function(data)
	             {
					 $.blockUI({ message: data,
					 css: { padding:'5px',color:'#CC0000'}});      
	             },
	             complete: function()
	             {
	                  $.unblockUI();
	             }
	        });
		 }
	});
	
	$("#cancelSendMsgBtn").click(function() 
	{
	    $.unblockUI();
	    sendMsgValidator.resetForm();
	});       

	$("#closeWindow>a").click(function() 
	{
	    $.unblockUI();
	});
}
	/*
	 * Yawei将DEL MSG的ajax整合至此 
	 */


